package ar.com.neolokura.travian.helper.bo.item;


import java.util.ArrayList;
import java.util.Date;

/**
 *
 * @author gustavo
 */
public class OasisItem {

    private Integer xCoord;
    private Integer yCoord;
    private Integer rats;
    private Integer spiders;
    private Integer snakes;
    private Integer bats;
    private Integer boars;
    private Integer wolfs;
    private Integer bears;
    private Integer crocodiles;
    private Integer tigers;
    private Integer elephants;
    private Integer wood;
    private Integer clay;
    private Integer iron;
    private Integer crop;
    private ArrayList<Date> reports;

    public OasisItem(Integer xCoord, Integer yCoord) {
        rats = 0;
        spiders = 0;
        snakes = 0;
        bats = 0;
        boars = 0;
        wolfs = 0;
        bears = 0;
        crocodiles = 0;
        tigers = 0;
        elephants = 0;
        wood = 0;
        clay = 0;
        iron = 0;
        crop = 0;
        this.xCoord = xCoord;
        this.yCoord = yCoord;

    }

    public Integer getInfantryDefenseValues() {
        Integer defense = rats * 25
                + spiders * 35
                + snakes * 40
                + bats * 66
                + boars * 70
                + wolfs * 80
                + bears * 140
                + crocodiles * 380
                + tigers * 170
                + elephants * 440;

        return defense;
    }

    public Integer getCavalryDefenseValues() {
        Integer defense = rats * 20
                + spiders * 40
                + snakes * 60
                + bats * 50
                + boars * 33
                + wolfs * 70
                + bears * 200
                + crocodiles * 240
                + tigers * 250
                + elephants * 520;

        return defense;
    }

    @Override
    
    public String toString() {
        String string = "Oasis desocupado (" + xCoord + "|" + yCoord + "):"
                //                + "\n - wood: " + wood
                //                + "\n - clay: " + clay
                //                + "\n - iron: " + iron
                //                + "\n - crop: " + crop
                + "\n";

        if (rats != 0) {
            string += "\nRatas = " + rats;
        }
        if (spiders != 0) {
            string += "\nArañas = " + spiders;
        }
        if (snakes != 0) {
            string += "\nSerpientes = " + snakes;
        }
        if (bats != 0) {
            string += "\nMurcielagos = " + bats;
        }
        if (boars != 0) {
            string += "\nJabalies = " + boars;
        }
        if (crocodiles != 0) {
            string += "\nCocodrilos = " + crocodiles;
        }
        if (tigers != 0) {
            string += "\nTigres = " + tigers;
        }
        if (elephants != 0) {
            string += "\nElefantes = " + elephants;
        }
        string += "\n\nDefense vs Cavalry: " + getCavalryDefenseValues();
        string += "\nDefense vs Infantry: " + getInfantryDefenseValues();
        string += "\n=====================================";
        return string;
    }

    public Integer getClay() {
        return clay;
    }

    public void setClay(Integer clay) {
        this.clay = clay;
    }

    public Integer getCrop() {
        return crop;
    }

    public void setCrop(Integer crop) {
        this.crop = crop;
    }

    public Integer getIron() {
        return iron;
    }

    public void setIron(Integer iron) {
        this.iron = iron;
    }

    public Integer getWood() {
        return wood;
    }

    public void setWood(Integer wood) {
        this.wood = wood;
    }

    public Integer getBats() {
        return bats;
    }

    public void setBats(Integer bats) {
        this.bats = bats;
    }

    public Integer getBears() {
        return bears;
    }

    public void setBears(Integer bears) {
        this.bears = bears;
    }

    public Integer getBoars() {
        return boars;
    }

    public void setBoars(Integer boars) {
        this.boars = boars;
    }

    public Integer getCrocodiles() {
        return crocodiles;
    }

    public void setCrocodiles(Integer crocodiles) {
        this.crocodiles = crocodiles;
    }

    public Integer getElephants() {
        return elephants;
    }

    public void setElephants(Integer elephants) {
        this.elephants = elephants;
    }

    public Integer getRats() {
        return rats;
    }

    public void setRats(Integer rats) {
        this.rats = rats;
    }

    public Integer getSnakes() {
        return snakes;
    }

    public void setSnakes(Integer snakes) {
        this.snakes = snakes;
    }

    public Integer getSpiders() {
        return spiders;
    }

    public void setSpiders(Integer spiders) {
        this.spiders = spiders;
    }

    public Integer getTigers() {
        return tigers;
    }

    public void setTigers(Integer tigers) {
        this.tigers = tigers;
    }

    public Integer getWolfs() {
        return wolfs;
    }

    public void setWolfs(Integer wolfs) {
        this.wolfs = wolfs;
    }

    public Integer getxCoord() {
        return xCoord;
    }

    public void setxCoord(Integer xCoord) {
        this.xCoord = xCoord;
    }

    public Integer getyCoord() {
        return yCoord;
    }

    public void setyCoord(Integer yCoord) {
        this.yCoord = yCoord;
    }

    public ArrayList<Date> getReports() {
        return reports;
    }

    public void setReports(ArrayList<Date> reports) {
        this.reports = reports;
    }
}
